<?php

	// Functions and Class
	require_once '../include/header.inc.php';
	require_once '../include/book.class.php';

	// Define page vars
	define('TPL', STYLE_PATH.'library/preface.html');
	define('ID', $_GET['id']);

	// Template class
	$tmp = new Template(TPL);

	// BOOK CLASS
	$book = new Book(ID);
	$book->setBook();

	// Navigations
	$tmp->setContent("CATEGORY",$tmp->category("category","library"));
	$tmp->setContent("NAVIGATION",$tmp->sections($book->BOOK['section_id']));
	$tmp->setContent("FOOTMENU",$tmp->category("foot"));
	$tmp->setContent("BOOKMENU",$tmp->navigation("bookmenu",FILENAME,ID));

	// Book from author
	$tmp->setContent("FROMAUTHOR",$book->fromAuthor(ID));

	// Read more
	$tmp->setContent("READMORE",$book->readMore(ID)); 

	// User bookmarks
	$tmp->setContent("BOOKMARKS",bookmarks(UID,SID));


	// BOOK VARS
	$tmp->setContent($book->BOOK);

	// Labels
	$tmp->setLabels();

	// Display all
	echo $tmp->vorlage;
?>